import java.util.Observable;
import java.util.Observer;


public class JMember implements Observer{

	JTopic topic;
	
	public void subscribeToTopic(JTopic topic){
		this.topic=topic;
		this.topic.addObserver(this);
	}
	
	public JTopic getSubscribedTopic() {
        return topic;
	}
	
	public void update(Observable arg, Object o){
		if(o instanceof JTopic){
			if(((JTopic)o).getId() == topic.getId()){
				topic=(JTopic) o;
			}
		}
	}
}
